-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw error when attempting to redefine ReactOnRails #1562
Throw error when attempting to redefine ReactOnRails #1562
Conversation
f8d635f
to
58b1d5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shakapacker and not webpacker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the new troubleshooting docs to docs/javascript/troubleshooting-when-using-shakapacker.md
, but kept the old one since it is related to webpacker. See c6d7da9.
node_package/src/ReactOnRails.ts
Outdated
throw new Error(` | ||
The ReactOnRails value exists in the ${ctx} scope, it may not be safe to overwrite it. | ||
|
||
This could be caused by setting Webpack's optimization.runtimeChunk to "true" or "multiple" - please check your Webpack configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be caused by setting Webpack's optimization.runtimeChunk to "true" or "multiple," rather than "single." Check your Webpack configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in cbde473.
58b1d5a
to
972fabb
Compare
Webpack configuration could cause react-on-rails to be imported multiple times in each runtime chunk, leading to the global ReactOnRails variable being overridden and client rendering crashes. This should be avoided by relying on a single runtime chunk. Read more at #1558.
cbde473
to
38910f2
Compare
Summary
Webpack configuration could cause react-on-rails to be imported multiple times in each runtime chunk, leading to the global ReactOnRails variable being overridden and client rendering crashes. This should be avoided by relying on a single runtime chunk.
Read more at #1558.
Pull Request checklist
Screenshots
This change is